home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / sozo2 / scsrc20.lzh / SZADB.LZH / ADB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-25  |  3.1 KB  |  154 lines

  1. /* Copyright (c) 1988 by Sozobon, Limited.  Authors: Johann Ruegg, Don Dugger
  2.  *
  3.  * Permission is granted to anyone to use this software for any purpose
  4.  * on any computer system, and to redistribute it freely, with the
  5.  * following restrictions:
  6.  * 1) No charge may be made other than reasonable charges for reproduction.
  7.  * 2) Modified versions must be clearly marked as such.
  8.  * 3) The authors are not responsible for any harmful consequences
  9.  *    of using this software, even if they result from defects in it.
  10.  *
  11.  *    adb.h
  12.  */
  13.  
  14. #define NUMERIC        3
  15. #define HEX        7
  16. #define ALPHA        5
  17. #define SPECCMD        8
  18. #define SPECX        16
  19.  
  20. #define ALPHANUM    1
  21. #define HEXDIG        2
  22. #define ALPHAONLY    4
  23.  
  24. #define BSIZE        512
  25. #define LOGBS        9
  26. #define SYMSZ        10
  27.  
  28. /*
  29.  *    Error types
  30.  */
  31. #define ACCESS        0    /* access outside address map */
  32. #define UNBAL        1    /* unbalanced parenthesis */
  33. #define UNKNOWN        2    /* unknown command */
  34. #define BADCMD        3    /* bad command at this time */
  35. #define BADNAME        4    /* cant find symbol */
  36. #define BADRNAME    5    /* cant find register */
  37.  
  38. #define sreg(a)    ((a) & 7)
  39. #define smod(a)    (((a) >> 3) & 7)
  40. #define dreg(a)    (((a) >> 9) & 7)
  41. #define dmod(a)    (((a) >> 6) & 7)
  42.  
  43. struct symbol {
  44.     char        flags;
  45.     unsigned long    value;
  46.     struct symbol * next;
  47.     char        name[1];    /* must be last */
  48. };
  49.  
  50. struct file {
  51.     int    fid;
  52.     int    flags;
  53.     int    pid;
  54.     char *    name;
  55.     struct symbol *symptr;
  56.     long    cblock;
  57.     char    buf[BSIZE + BSIZE];
  58. };
  59.  
  60. #define SUBPCS    1
  61.  
  62. /*
  63.  *    Base page layout
  64.  */
  65.  
  66. struct basepg {
  67.     char *        p_lowtpa;    /* base address of TPA */
  68.     char *        p_hitpa;    /* end of TPA */
  69.     char *        p_tbase;    /* base address of text */
  70.     unsigned long    p_tlen;        /* length of text */
  71.     char *        p_dbase;    /* base of data */
  72.     unsigned long    p_dlen;        /* length of data */
  73.     char *        p_bbase;    /* base of bss */
  74.     unsigned long    p_blen;        /* length of bss */
  75.     char *        p_dta;
  76.     struct basepg * p_parent;
  77.     long        p_res;
  78.     char *        p_env;        /* ptr to environment string */
  79.     long        p_fill[20];
  80.     char        p_cmdlin[0x80];    /* command line image */
  81. };
  82.  
  83. struct regs {
  84.     char *        name;
  85.     unsigned long *    value;
  86. };
  87.  
  88. #define TBITS    0xc000
  89. #define ITRACE    0x8000
  90.  
  91. #define PC    0
  92. #define SR    1
  93. #define XSP    2
  94. #define D0    3
  95. #define A0    11
  96. #define FP    (A0 + 6)
  97. #define SP    (A0 + 7)
  98. #define MAXBPTS        10
  99.  
  100. #define BPT        0x4afc
  101.  
  102. #define BP_VALID    1
  103. #define BP_ACTIVE    2
  104.  
  105. struct bpt {
  106.     int    flag;
  107.     int    instr;
  108.     long    addr;
  109. };
  110. #define START_DBG    0
  111. #define RD_TEXT        1
  112. #define RD_DATA        2
  113. #define RD_USER        3
  114. #define WR_TEXT        4
  115. #define WR_DATA        5
  116. #define WR_USER        6
  117. #define CONTINUE    7
  118. #define KILL_PID    8
  119. #define SSTEP        9
  120.  
  121. long ptrace();
  122.  
  123. struct fheader {
  124.     short    magic;
  125.     long    tsize;
  126.     long    dsize;
  127.     long    bsize;
  128.     long    ssize;
  129.     long    stksize;
  130.     long    entry;
  131.     short    flag;
  132. };
  133.  
  134. #define MAGIC    0x601a
  135.  
  136. struct filsym {
  137.     char    name[8];
  138.     short    flag;
  139.     long    value;
  140. };
  141.  
  142. #define S_DEF    0100000
  143. #define S_EQU    0040000
  144. #define S_EXT    0020000
  145. #define S_REG    0010000
  146. #define S_REF    0004000
  147. #define S_DATA    0002000
  148. #define S_TEXT    0001000
  149. #define S_BSS    0000400
  150. #define S_FIL    0000200
  151.  
  152. #define S_EXTEND    (S_TEXT|S_EQU)
  153. #define NAMEMAX        80
  154.